<?php
    use User\Model\MeetingModel;
?>
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                条件详情
            </header>
            <div class="panel-body">
                <form class="form-horizontal" method="post"
                      action="/User/Tool/condUpdate">
                    <input type="hidden" value="<?php $val = (!empty($cond)) ?
                            $cond['cond_id'] : ''; echo $val;?>" name="condId" id="condId">
                    <input type="hidden" value="<?php echo I('get.specId', '', '');?>" name="spec_id" id="spec_id">
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">A+个数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="ap" value="<?php $val=(!empty($cond)) ?
                            $cond['ap'] : ''; echo $val;?>" id="ap">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">B+个数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="bp" value="<?php $val=(!empty($cond)) ?
                            $cond['bp'] : ''; echo $val;?>" id="bp">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">C+个数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="cp" value="<?php $val=(!empty($cond)) ?
                            $cond['cp'] : ''; echo $val;?>" id="cp">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">D+个数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dp" value="<?php $val=(!empty($cond)) ?
                            $cond['dp'] : ''; echo $val;?>" id="dp">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">A+B个数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="abp" value="<?php $val=(!empty($cond)) ?
                            $cond['abp'] : ''; echo $val;?>" id="abp">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">思政等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="szs" value="<?php $val=(!empty($cond)) ?
                            $cond['szs'] : ''; echo $val;?>" id="szs">
                            <p class="help-block">1对应D,2对应C,3对应B,4对应A。</p>
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">历史等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="lss" value="<?php $val=(!empty($cond)) ?
                            $cond['lss'] : ''; echo $val;?>" id="lss">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">地理等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dls" value="<?php $val=(!empty($cond)) ?
                            $cond['dls'] : ''; echo $val;?>" id="dls">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">物理等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="wls" value="<?php $val=(!empty($cond)) ?
                            $cond['wls'] : ''; echo $val;?>" id="wls">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">化学等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="hxs" value="<?php $val=(!empty($cond)) ?
                            $cond['hxs'] : ''; echo $val;?>" id="hxs">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">生物等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sws" value="<?php $val=(!empty($cond)) ?
                            $cond['sws'] : ''; echo $val;?>" id="sws">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">技术等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="jss" value="<?php $val=(!empty($cond)) ?
                            $cond['jss'] : ''; echo $val;?>" id="jss">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">英语等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yys" value="<?php $val=(!empty($cond)) ?
                            $cond['yys'] : ''; echo $val;?>" id="yys">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">语文等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yws" value="<?php $val=(!empty($cond)) ?
                            $cond['yws'] : ''; echo $val;?>" id="yws">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">数学等级:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sxs" value="<?php $val=(!empty($cond)) ?
                            $cond['sxs'] : ''; echo $val;?>" id="sxs">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">必选科目:</label>
                        <div class="col-lg-4">
                            思政<input type="checkbox" name="sz_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['sz_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            历史<input type="checkbox" name="ls_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['ls_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            地理<input type="checkbox" name="dl_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['dl_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            物理<input type="checkbox" name="wl_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['wl_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            化学<input type="checkbox" name="hx_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['hx_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            生物<input type="checkbox" name="sw_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['sw_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                            技术<input type="checkbox" name="js_must" value="1" <?php
                            if(!empty($cond)){
                                if($cond['js_must'] == 1){
                                    echo "checked";
                                }
                            }
                            ?>>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">总分:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="score" value="<?php $val=(!empty($cond)) ?
                            $cond['score'] : ''; echo $val;?>" id="score">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">思政A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sza" value="<?php $val=(!empty($cond)) ?
                            $cond['sza'] : ''; echo $val;?>" id="sza">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">思政B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="szb" value="<?php $val=(!empty($cond)) ?
                            $cond['szb'] : ''; echo $val;?>" id="szb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">思政C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="szc" value="<?php $val=(!empty($cond)) ?
                            $cond['szc'] : ''; echo $val;?>" id="szc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">思政D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="szd" value="<?php $val=(!empty($cond)) ?
                            $cond['szd'] : ''; echo $val;?>" id="szd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">历史A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="lsa" value="<?php $val=(!empty($cond)) ?
                            $cond['lsa'] : ''; echo $val;?>" id="lsa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">历史B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="lsb" value="<?php $val=(!empty($cond)) ?
                            $cond['lsb'] : ''; echo $val;?>" id="lsb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">历史C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="lsc" value="<?php $val=(!empty($cond)) ?
                            $cond['lsc'] : ''; echo $val;?>" id="lsc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">历史D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="lsd" value="<?php $val=(!empty($cond)) ?
                            $cond['lsd'] : ''; echo $val;?>" id="lsd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">地理A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dla" value="<?php $val=(!empty($cond)) ?
                            $cond['dla'] : ''; echo $val;?>" id="dla">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">地理B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dlb" value="<?php $val=(!empty($cond)) ?
                            $cond['dlb'] : ''; echo $val;?>" id="dlb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">地理C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dlc" value="<?php $val=(!empty($cond)) ?
                            $cond['dlc'] : ''; echo $val;?>" id="dlc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">地理D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="dld" value="<?php $val=(!empty($cond)) ?
                            $cond['dld'] : ''; echo $val;?>" id="dld">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">物理A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="wla" value="<?php $val=(!empty($cond)) ?
                            $cond['wla'] : ''; echo $val;?>" id="wla">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">物理B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="wlb" value="<?php $val=(!empty($cond)) ?
                            $cond['wlb'] : ''; echo $val;?>" id="wlb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">物理C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="wlc" value="<?php $val=(!empty($cond)) ?
                            $cond['wlc'] : ''; echo $val;?>" id="wlc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">物理D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="wld" value="<?php $val=(!empty($cond)) ?
                            $cond['wld'] : ''; echo $val;?>" id="wld">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">化学A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="hxa" value="<?php $val=(!empty($cond)) ?
                            $cond['hxa'] : ''; echo $val;?>" id="hxa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">化学B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="hxb" value="<?php $val=(!empty($cond)) ?
                            $cond['hxb'] : ''; echo $val;?>" id="hxb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">化学C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="hxc" value="<?php $val=(!empty($cond)) ?
                            $cond['hxc'] : ''; echo $val;?>" id="hxc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">化学D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="hxd" value="<?php $val=(!empty($cond)) ?
                            $cond['hxd'] : ''; echo $val;?>" id="hxd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">生物A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="swa" value="<?php $val=(!empty($cond)) ?
                            $cond['swa'] : ''; echo $val;?>" id="swa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">生物B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="swb" value="<?php $val=(!empty($cond)) ?
                            $cond['swb'] : ''; echo $val;?>" id="swb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">生物C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="swc" value="<?php $val=(!empty($cond)) ?
                            $cond['swc'] : ''; echo $val;?>" id="swc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">生物D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="swd" value="<?php $val=(!empty($cond)) ?
                            $cond['swd'] : ''; echo $val;?>" id="swd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">技术A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="jsa" value="<?php $val=(!empty($cond)) ?
                            $cond['jsa'] : ''; echo $val;?>" id="jsa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">技术B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="jsb" value="<?php $val=(!empty($cond)) ?
                            $cond['jsb'] : ''; echo $val;?>" id="jsb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">技术C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="jsc" value="<?php $val=(!empty($cond)) ?
                            $cond['jsc'] : ''; echo $val;?>" id="jsc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">技术D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="jsd" value="<?php $val=(!empty($cond)) ?
                            $cond['jsd'] : ''; echo $val;?>" id="jsd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">英语A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yya" value="<?php $val=(!empty($cond)) ?
                            $cond['yya'] : ''; echo $val;?>" id="yya">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">英语B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yyb" value="<?php $val=(!empty($cond)) ?
                            $cond['yyb'] : ''; echo $val;?>" id="yyb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">英语C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yyc" value="<?php $val=(!empty($cond)) ?
                            $cond['yyc'] : ''; echo $val;?>" id="yyc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">英语D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="yyd" value="<?php $val=(!empty($cond)) ?
                            $cond['yyd'] : ''; echo $val;?>" id="yyd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">语文A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="ywa" value="<?php $val=(!empty($cond)) ?
                            $cond['ywa'] : ''; echo $val;?>" id="ywa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">语文B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="ywb" value="<?php $val=(!empty($cond)) ?
                            $cond['ywb'] : ''; echo $val;?>" id="ywb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">语文C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="ywc" value="<?php $val=(!empty($cond)) ?
                            $cond['ywc'] : ''; echo $val;?>" id="ywc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">语文D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="ywd" value="<?php $val=(!empty($cond)) ?
                            $cond['ywd'] : ''; echo $val;?>" id="ywd">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">数学A对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sxa" value="<?php $val=(!empty($cond)) ?
                            $cond['sxa'] : ''; echo $val;?>" id="sxa">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">数学B对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sxb" value="<?php $val=(!empty($cond)) ?
                            $cond['sxb'] : ''; echo $val;?>" id="sxb">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">数学C对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sxc" value="<?php $val=(!empty($cond)) ?
                            $cond['sxc'] : ''; echo $val;?>" id="sxc">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label need">数学D对应分数:</label>

                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="sxd" value="<?php $val=(!empty($cond)) ?
                            $cond['sxd'] : ''; echo $val;?>" id="sxd">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <button class="btn btn-primary" type="submit" id="submit">提交</button>
                            <button class="btn btn-default" type="button" onclick="history.back(-1);">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
</div>
<script>

    $("#submit").click(function () {

        var data = $("form").serialize();
        var url = $("form").attr("action");
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: url,
            async:false,
            success: function (res) {
                if (res.code == 1) {
                    alert("提交成功");
                    var spec_id = "<?php echo I('get.specId', '', '');?>";
                    var sch_id = "<?php echo I('get.schId', '', '');?>";
                    window.location = '/User/Tool/cond?specId=' + spec_id + '&schId=' + sch_id;
                } else {
                    alert(res.msg);
                }
            }
        });
        return false;
    });
</script>